package nf.traversal;

import java.util.List;
import java.util.Iterator;
import nf.graph.Node;
import nf.util.Rational;
import nf.utility.UtilityCalculator;
import nf.graph.Delta;
import nf.graph.Graph;
import nf.graph.Path;

/**
 * Traverses a social network, choosing the node(s) to consider at any one time,
 * and calculating which edges each node wishes to add and remove.
 */
public abstract class Traverser implements Iterator<List<Node>>
{
	/**
	 * The social network over which traversion should occur.
	 */
	protected Graph network;
	
	public Traverser(Graph network)
	{
		this.network = network;
	}
	
	/**
	 * Returns the traverser's social network
	 * @return Traverser's social network
	 */
	public Graph getNetwork()
	{
	    return network;
	}
	
	/**
	 * Gives feedback to the traverser. Can be used to implement "fairness".
	 */
	public void reportResult(Delta changes)
	{
		// do nothing by default
	}
	
	public abstract boolean hasNext();
	
	public abstract List<Node> next();
	
	public void remove()
	{
		throw new UnsupportedOperationException();
	}
}
